package com.copa.module.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.copa.annotation.Log;
import com.copa.domain.ResponseDto;
import com.copa.module.system.domain.entity.ConfigEntity;
import com.copa.module.system.domain.vo.ConfigListVo;
import com.copa.module.system.domain.vo.ConfigUpdateVo;
import com.copa.module.system.service.ConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author copa
 * @createDate 2021-02-22 10:04
 * @function
 */
@RestController
@Api(tags = {"配置接口"})
public class ConfigController {

    @Autowired
    private ConfigService configService;

    @ApiOperation(value = "查看配置详情列表")
    @PostMapping("/config/list")
    public ResponseDto<IPage<ConfigEntity>> list(@RequestBody ConfigListVo configListVo) {
        return configService.list(configListVo);
    }

    @Log("修改配置")
    @ApiOperation(value = "修改配置")
    @PostMapping("/config/put")
    public ResponseDto<String> put(@RequestBody ConfigUpdateVo configUpdateVo) {
        return configService.put(configUpdateVo);
    }

}
